package com.qch.edu.ad;

import com.qch.edu.ad.dto.PromotionSpaceDTO;
import com.qch.edu.ad.remote.AdRemoteService;
import com.qch.edu.response.ResponseDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author qch
 * @Date 2021/9/3
 */
@RestController
@RequestMapping("/ad")
public class AdController {
    @Autowired
    private AdRemoteService adRemoteService;

    /**
     *
     * @return ResponseDTO统一返回对象
     */
    @RequestMapping("/space/getAllSpaces")
    public ResponseDTO getAllSpaces(){
        List<PromotionSpaceDTO> allSpace = adRemoteService.getAllSpace();
        return ResponseDTO.success(allSpace);
    }
}
